#define DEBUG
#include <cstdio>
#include <cstring>

using namespace std;

const int maxn=100, mods=1000000007;

int max(int a, int b) {
  return a>b ? a : b;
}

long long solve(int o, int n, int x, int y) {
  static bool book[maxn+1];
  static int seq[maxn+1];
  static int f[maxn+2][maxn+1];
  if (o>1) {
    for (int i=0; i<=n; i++) {
      f[o][i] = f[o-1][i];
    }
    f[o][seq[o-1]] = max(1, f[o][seq[o-1]]);
    for (int i=n; i>seq[o-1]; i--) {
      f[o][seq[o-1]] = max(f[o][seq[o-1]], f[o-1][i]+1);
      if (f[o][seq[o-1]]>2) {
	return 0;
      }
    }
  }
  if (o>n) {
    return 1;
  } else if (o==x) {
    book[y] = true;
    seq[o] = y;
    long long ret=solve(o+1, n, x, y);
    book[y] = false;
    return ret;
  } else {
    long long ret=0;
    for (int i=1; i<=n; i++) {
      if (!book[i] && i!=y) {
	book[i] = true;
	seq[o] = i;
	ret = (ret+solve(o+1, n, x, y))%mods;
	book[i] = false;
      }
    }
    return ret;
  }
}

int main() {
  freopen("tg.in", "r", stdin);
  freopen("tg.out", "w", stdout);

  int t;
  scanf("%d", &t);
  for (int ti=1; ti<=t; ti++) {
    int n, x, y;
    scanf("%d %d %d", &n, &x, &y);
    printf("%lld\n", solve(1, n, x, y));
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
